-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add netstat sample application #40
Conversation
d76cdfe
to
7952895
Compare
7952895
to
7a55a6a
Compare
- Move parse lines into lines.hpp - Move to_number into number.hpp - Move to_sequence into proc_stat.cpp
7a55a6a
to
1bef73e
Compare
Note: this currently fails to build for me with g++ 12 / clang++ 14(using Debian 12). It's not immediately obvious to me why it fails on these types and it doesn't for the other types. Here's the clang error(g++ errors on the same lines):
One possibly confusing thing: it seems that the filter returns
|
Thanks for the useful comments @rm5248. |
sample/tool_netstat.cpp
Outdated
return inodes.find(sock.inode) == inodes.end() | ||
? pfs::filter::action::keep | ||
: pfs::filter::action::drop; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return value here is backwards, it should be:
return inodes.find(sock.inode) == inodes.end() | |
? pfs::filter::action::keep | |
: pfs::filter::action::drop; | |
return inodes.find(sock.inode) == inodes.end() | |
? pfs::filter::action::drop | |
: pfs::filter::action::keep; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are totally right. Thanks for noticing. Fixed.
This looks pretty good to me; I think the ability to add in the custom filters is a good trade-off to make it easy to filter things from only one process while still making it be "just parse |
d39e703
to
489bfea
Compare
Thank you! I'm happy you find this resolution suitable! |
An alternative suggestion to #38 and #39.